-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-141004: Document remaining pyport.h utility macros
#144279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-141004: Document remaining pyport.h utility macros
#144279
Conversation
Doc/c-api/intro.rst
Outdated
| *type* is the type of the expression. In modern versions of Python, this is | ||
| unused. Historically, *type* was used to cast *integer*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we reformulate this more precisely through a versionchanged? And indicate that the parameter is unused and kept for backward compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's already a versionchanged that specifies this below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry. In this case, I think we can just say that it's not used anymore and only kept for BC. The change has been done in 3.1 so whatever is after 3.1 is already "modern" Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
|
||
| *value*, *larger*, and *smaller* may all be evaluated more than once in the | ||
| expression; consequently, do not pass an expensive operation directly to | ||
| this macro. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expressions with side effects (ex: value++) should also be avoided.
Co-authored-by: Victor Stinner <vstinner@python.org>
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…GH-144279) (cherry picked from commit 914fbec) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
|
GH-144477 is a backport of this pull request to the 3.14 branch. |
|
GH-144478 is a backport of this pull request to the 3.13 branch. |
…GH-144279) (cherry picked from commit 914fbec) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…4279) (GH-144477) gh-141004: Document remaining `pyport.h` utility macros (GH-144279) (cherry picked from commit 914fbec) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…4279) (GH-144478) gh-141004: Document remaining `pyport.h` utility macros (GH-144279) (cherry picked from commit 914fbec) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
…GH-144279) Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
📚 Documentation preview 📚: https://cpython-previews--144279.org.readthedocs.build/en/144279/c-api/intro.html#useful-macros